import axios from "axios"

export function request(config) {

  //3.1创建实例
  const instace = axios.create({
      baseURL:"http://123.207.32.32:8000/api/hy",
      // baseURL = "http://106.54.54.237:8000/api/hy",
      timeout:5000
  })

  //3.2拦截
  instace.interceptors.request.use(
    config => {
      return config
    },
    err => {
      console.log(err);
    }
  )
  instace.interceptors.response.use(
    res => {
      return res
    },
    err => {
      console.log(err);
    }
  )

  //发送网络请求
  return instace(config)

}
